package com.neuedu.array;

/**
 * 数组的复制
 */
public class ArrayCopy {

    public static void main(String[] args) {

        //原数组
        int srcArray[] =  {10,200,300,4090};

        //目标数组
        int distArray[] =  new int[srcArray.length];

        // for (int i = 0; i < srcArray.length; i++) {
        //     distArray [i] =  srcArray[i];
        // }

        // System.arraycopy(srcArray,0,distArray,0,srcArray.length);
        // System.arraycopy(srcArray,0,distArray,0,3);
        System.arraycopy(srcArray,1,distArray,1,3);



        for (int i = 0; i < srcArray.length; i++) {
            System.out.print( srcArray[i]+"\t");
        }
        System.out.println();
        for (int i = 0; i < distArray.length; i++) {
            System.out.print( distArray[i]+"\t");
        }




        //工具类








    }







}
